/**
 * 
 */
package com.cdhospital.admincontroller;

import com.cdhospital.Model.Graduatemessage;
import com.cdhospital.websiteservice.GraduatemessageService;
import com.jfinal.core.Controller;

/**
 * @author 17994
 *
 */
public class AdminGraduatemessageController extends Controller {
   static GraduatemessageService service=new GraduatemessageService();
	public void index(){
		String title=null;
		Integer status=getParaToInt("status");
		if(status==null){
			status=1;
		}
		if(status==1){
			title="研究所概况";
		}
		else	if(status==2){
			title="所长寄语";
		}
		else if(status==3){
			title="研究所介绍";
		}
		else if(status==4){
			title="研究所荣誉";
		}
		else if(status==5){
			title="历史改革";
		}
		else if(status==6){
			title="联系我们";
		}
		setAttr("graduate", service.findbyStatus(status));
		setAttr("title", title);
		render("index.html");
	}
	
	public void save(){
		String content=getPara("content");
		Integer status=getParaToInt("status");
		Graduatemessage graduatemessage=service.findbyStatus(status);
		graduatemessage.setContent(content);
		graduatemessage.update();
		renderJson();
		
	}
	

}
